{% extends "sysadmin/base.html" %}
{% load seahub_tags i18n %}

{% block cur_groups %}tab-cur{% endblock %}

{% block right_panel %}
<h3 class="hd">{% trans "All Groups" %}</h3>

{% if groups %}
<table>
    <tr>
        <th width="30%">{% trans "Name" %}</th>
        <th width="30%">{% trans "Creator" %}</th>
        <th width="25%">{% trans "Create At" %}</th>
        <th width="15%">{% trans "Operations" %}</th>
    </tr>
    {% for group in groups %}
    <tr>
        <td>
            <a href="{{ SITE_ROOT }}group/{{ group.props.id }}/">{{ group.props.group_name }}</a>
            {% if group.org_name %}
            <p style="font-size:11px;"><a href="{% url 'sys_org_info_user' group.org_id %}">({{group.org_name}})</a></p>
            {% endif %}
        </td>
        <td>{{ group.props.creator_name }}</td>
        <td>{{ group.props.timestamp|tsstr_sec }}</td>
        <td><img src="{{MEDIA_URL}}img/rm.png" alt="" data-url="{% url 'group_remove' group.id %}" data-target="{{ group.props.group_name }}" class="rm-grp op-icon vh" title="{% trans "Delete" %}" /></td>
    </tr>
    {% endfor %}
</table>

{% include "snippets/admin_paginator.html" %}

{% else %}
<p>{% trans "Empty" %}</p>
{% endif %}
{% endblock %}

{% block extra_script %}
<script type="text/javascript">
addConfirmTo($('.rm-grp'), {
    'title': "{% trans "Delete Group" %}",
    'con': "{% trans "Are you sure you want to delete %s ?" %}"
});
</script>
{% endblock %}
 
